/*************************************************************************
    > File Name: myfile.c
    > Author: ma6174
    > Mail: ma6174@163.com 
    > Created Time: Sun 02 Nov 2025 08:58:50 AM CST
 ************************************************************************/

#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>


int main()
{
	close(1);
	int fd1 = open("log1.txt", O_WRONLY | O_CREAT | O_APPEND, 0666);

    printf("fd1: %d\n", fd1);
	fprintf(stdout,"helloworld\n");

	//fflush(stdout);
    //close(fd1);
	fclose(stdout);
	return 0;
}

